<template>
  <!-- 账号管理页面 -->
  <div class="world">
    <head-nav></head-nav>
    <div class="contentBox">
      <user-info :user="user"></user-info>
      <diy-info></diy-info>
      <logo-medule></logo-medule>
    </div>
  </div>
</template>

<script>
// 头部组件
import headNav from "../components/common/headTitle.vue";
// 用户信息
import userInfo from "../components/userMag/userCar.vue";
// 修改操作
import diyInfo from "../components/userMag/diyInfo.vue";
// logo组件
import logoMedule from "../components/userMag/logoMedule.vue";

export default {
  data() {
    return {
      title: "账号管理",
      infoBtn: [
        { content: "修改登录密码", id: 1 },
        { content: "修改个人信息", id: 2 },
        { content: "收获地址管理", id: 3 },
      ],
      user: "",
    };
  },
  components: {
    headNav,
    userInfo,
    diyInfo,
    logoMedule,
  },
  created() {
    // 请求用户信息
    let info = {
      type: "get",
      url: "/user/info",
    };
    this.$netWork(info).then((res) => {
      if (res.data.status === 0) {
        this.user = res.data.data;
        let userImg = sessionStorage.getItem("userImg");
        if (userImg) {
          this.user.userImg = userImg;
        }
      }
    });
  },
};
</script>

<style lang="scss" scoped>
.world {
  width: 100%;
  height: 100%;
  .contentBox {
    padding-top: 48px;
  }
}
</style>
